package cn.gson.boot.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

@Entity
public class Ruku {
    private int rkId;//入库id
    private String rkHao;//入库单号
    private Integer rkOtherid;//其它表id
    private Timestamp rkTime;//入库时间
    private String rkShuoming;//入库说明
    private String rkPeople;//操作人
    private int rkYs;//判断是否已经入库(1是，0否)
    private Timestamp rkSqtime;//入库申请时间


    @Column(name = "rk_ys")
    public int getRkYs() {
        return rkYs;
    }

    public void setRkYs(int rkYs) {
        this.rkYs = rkYs;
    }

    @Column(name = "rk_sqtime")
    public Timestamp getRkSqtime() {
        return rkSqtime;
    }

    public void setRkSqtime(Timestamp rkSqtime) {
        this.rkSqtime = rkSqtime;
    }

    private List<Rukuxiangqin> rukuxiangqinList;

    @OneToMany(mappedBy = "ruku")
    public List<Rukuxiangqin> getRukuxiangqinList() {
        return rukuxiangqinList;
    }

    public void setRukuxiangqinList(List<Rukuxiangqin> rukuxiangqinList) {
        this.rukuxiangqinList = rukuxiangqinList;
    }

    @Id
    @Column(name = "rk_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getRkId() {
        return rkId;
    }

    public void setRkId(int rkId) {
        this.rkId = rkId;
    }

    @Basic
    @Column(name = "rk_hao", nullable = true, length = 200)
    public String getRkHao() {
        return rkHao;
    }

    public void setRkHao(String rkHao) {
        this.rkHao = rkHao;
    }

    @Basic
    @Column(name = "rk_otherid", nullable = true)
    public Integer getRkOtherid() {
        return rkOtherid;
    }

    public void setRkOtherid(Integer rkOtherid) {
        this.rkOtherid = rkOtherid;
    }

    @Basic
    @Column(name = "rk_time", nullable = true)
    public Timestamp getRkTime() {
        return rkTime;
    }

    public void setRkTime(Timestamp rkTime) {
        this.rkTime = rkTime;
    }

    @Basic
    @Column(name = "rk_shuoming", nullable = true, length = 200)
    public String getRkShuoming() {
        return rkShuoming;
    }

    public void setRkShuoming(String rkShuoming) {
        this.rkShuoming = rkShuoming;
    }

    @Basic
    @Column(name = "rk_people", nullable = true, length = 200)
    public String getRkPeople() {
        return rkPeople;
    }

    public void setRkPeople(String rkPeople) {
        this.rkPeople = rkPeople;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Ruku ruku = (Ruku) o;
        return rkId == ruku.rkId &&
                Objects.equals(rkHao, ruku.rkHao) &&
                Objects.equals(rkOtherid, ruku.rkOtherid) &&
                Objects.equals(rkTime, ruku.rkTime) &&
                Objects.equals(rkShuoming, ruku.rkShuoming) &&
                Objects.equals(rkPeople, ruku.rkPeople);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rkId, rkHao, rkOtherid, rkTime, rkShuoming, rkPeople);
    }
}
